package com.banquetmanagementsystem.common.context;

/**
 * @author 86176
 */
public class BaseContext {
    public static ThreadLocal<Integer> threadLocalId = new ThreadLocal<>();
    public static void setThreadLocalId(Integer id){
        threadLocalId.set(id);
    }
    public static Integer getThreadLocalId(){
        return threadLocalId.get();
    }
    public static void removeThreadLocalId(){
        threadLocalId.remove();
    }
    public static ThreadLocal<String> threadLocalName = new ThreadLocal<>();
    public static void setThreadLocalName(String name){
        threadLocalName.set(name);
    }
    public static String getThreadLocalName(){
        return threadLocalName.get();
    }
    public static void removeThreadLocalName(){
        threadLocalName.remove();
    }
    public static  ThreadLocal<Boolean> threadLocalIsWeeklyDurationEnabled = new ThreadLocal<>();
    public static void setThreadLocalIsWeeklyDurationEnabled(Boolean isWeeklyDurationEnabled){
        threadLocalIsWeeklyDurationEnabled.set(isWeeklyDurationEnabled);
    }
    public static Boolean getThreadLocalIsWeeklyDurationEnabled(){
        return threadLocalIsWeeklyDurationEnabled.get();
    }
    public static void removeThreadLocalIsWeeklyDurationEnabled(){
        threadLocalIsWeeklyDurationEnabled.remove();
    }
}
